<template>
  <div>
    <div class="title">热销推荐</div>
    <router-link
    tag="div"
    class="item"
    :to="'/detail/' + item.id"
    v-for='item in infoList'
    :key='item.id'
    >
      <div class="item-img-wrap"><img class="item-img" :src="item.imgUrl" alt=""></div>
      <div class="item-info">
        <h3 class="item-title">{{item.title}}</h3>
        <div class="item-desc">{{item.desc}}</div>
        <button class="item-button">查看详情</button>
      </div>
    </router-link>
  </div>
</template>

<script>
export default {
  props: {
    infoList: Array
  }
}
</script>

<style lang="stylus" scoped>
  .title
    line-height: .6rem
    font-size: .32rem
    font-weight: 500
    background-color: #f1f1f1
  .item
    display: flex;
    overflow: hidden;
    height: 1.6rem;
    margin-bottom: .1rem;
    .item-img-wrap
      width: 1.6rem;
      height: 1.6rem;
      padding: .1rem;
      .item-img
        width: 100%;
        height: 100%;
    .item-info
      flex: 1;
      padding: .1rem;
      .item-title
        font-size: .32rem
        margin-bottom: .1rem;

      .item-desc
        color: #ccc;
        margin-bottom: .2rem;
      .item-button
        background-color: #ff8e00;
        color: #fff;
        font-weight: 600;
        padding: 0 .2rem
        border-radius: .06rem
</style>
